import {goLogin} from "../../api/user.js"
import {setStorage,getStorage} from '../../utility/local.js';
export default  {
		namespaced: true,
		state:{
			//登录的个人信息进行存储
			userInfo:getStorage()
		},
		mutations:{
			GET_USERINFO(state,data){
				state.userInfo = data
			}
		},
		actions:{
			async getUserInfo(context,data){
			  const res =  await goLogin(data)
			  context.commit('GET_USERINFO',res.data)
			  setStorage(res.data)
			  uni.reLaunch({
			  	url:'/pages/my/my',
				animationType:'pop-in',
				animationDuration:1000
			  })
			}
		},
		getters:{}
}
